import java.util.*;


public class _2023_10_17 {
    public static void main1(String[] args) {
        Scanner sc = new Scanner(System.in);
        int year = sc.nextInt();
        int month = sc.nextInt();
        int day = sc.nextInt();

        int[] days ={0,
                    31,28,31,
                    30,31,30,
                    31,31,30,
                    31,30,31};

        if((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)){
            days[2]++;
        }

        int i = 0;
        int ans = 0;
        for(i = 1; i < month; i++){
            ans += days[i];
        }
        ans += day;
        System.out.println(ans);
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] arr = new int[n];
        for(int i = 0; i < n; i++){
            arr[i] = sc.nextInt();
        }
        Arrays.sort(arr);
        long[] sum = new long[n + 1];
        long[] mul = new long[n + 1];
        mul[0] = 1;
        for(int i = 1; i <= n; i++){
            sum[i] = sum[i - 1] + arr[i - 1];
            mul[i] = mul[i - 1] * arr[i - 1];
        }

        int ans = 0;
       for(int i = 0; i < n; i++){
           for(int j = i + 1; j <= n; j++){
               if(sum[j] - sum[i] > (mul[j] / mul[i])){
                   System.out.println(sum[j] + " " + sum[i]);
                   ans++;
               }
           }
       }
        System.out.println(ans);
    }
}
